<?php

namespace App\Admin\Repositories;

use App\Models\OrgDepartmentOwner as Model;
use Dcat\Admin\Repositories\EloquentRepository;

class OrgDepartmentOwner extends EloquentRepository
{
    /**
     * Model.
     *
     * @var string
     */
    protected $eloquentClass = Model::class;

    public function getOwnerListByDepartmentId(int $departmentId) : array
    {
        return $this->eloquentClass::query()->where('department_id', $departmentId)->get()->toArray();
    }

    public function getDepartmentListByOwnerUid(int $ownerUid) : object
    {
        return $this->eloquentClass::query()->where('owner_uid', $ownerUid)->get();
    }
}
